<template>
	<el-dialog v-model="visible" :title="'项目进度'" :close-on-click-modal="false" draggable width="70%">
		<el-timeline style="overflow: auto;max-height: 400px;">
				<el-timeline-item v-for="(val,num) in dataForm.datalist" :icon="MoreFilled" :color="dataForm.color" placement="top">
					<h4>{{val.createTime}}</h4>
					<el-card style="margin-top: 15px;">
					<h4>{{val.remark}}</h4>
					</el-card>
				</el-timeline-item>
		</el-timeline>
		<template #footer>
			<div class="divbtn">
				<el-button @click="visible = false">取消</el-button>
			</div>
		</template>
	</el-dialog>
</template>

<script setup lang="ts">
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus/es'
import { MoreFilled } from '@element-plus/icons-vue'
import {useProjectInfoListApi} from '@/api/sys/projectinfo'
const emit = defineEmits(['refreshDataList'])

const visible = ref(false)
const dataFormRef = ref()
const dataForm = reactive({
	projectId:'',
	datalist:[] as any,
	color:'#0bbd87'
})
const init = (obj:any) => {
	visible.value = true
	dataForm.projectId=obj.uid;
	// 重置表单数据
	if (dataFormRef.value) {
		dataFormRef.value.resetFields()
	}
	// id 存在则为修改
	if (obj) {
		getProjectList(obj.uid);
	}else{
	}
}
// 获取信息
const getProjectList = (projectId: any) => {
	let param={'projectId':projectId,page:1,limit:1}
	useProjectInfoListApi(param).then(res => {
		Object.assign(dataForm.datalist, res.data)
	})
}

defineExpose({
	init
})
</script>


<style lang="scss" scoped>
.divline {
	width: 96%;
	height: 30px;
	float: left;
	margin-top: 20px;
}
.divlinepro{
	
	width: 96%;
	height: 30px;
	float: left;
	margin-top: 50px;
}
.divfileline{
	width: 96%;
	float: left;
	margin-left: 40px;
	margin-top: 40px;
}
.divlineleft{
	width: 47%;
	float: left;
	height: 30px;
	padding-left: 10px;
}

.divlinecenter{
	width: 95.5%;
	float: left;
	height: 30px;
	padding-left: 10px;
}
.divbtn{
	text-align: center;
	margin-top: 20px;

}
.eduline{
	width: 96%;
	float: left;
	height: 50px;
	margin-top: 15px;
	border-bottom: 1px solid #BEBEBE;
	border-top: 1px solid #BEBEBE;
}
.divsplit{
	width: 96%;
	float: left;
	height: 1px;
	background-color:#409eff;
    margin-top: 5px;
}
.divsplit:last-child{
	width: 96%;
	float: left;
	height: 1px;
}
.eduitem{
	width: 20%;
	height: 30px;
	float: left;
    padding-top: 10px;
}
.inputVal.el-input__wrapper{
	width: 60%;
	float: left;
	height: 30px;
}
.inputVal.el-input{
	width: 60%;
	float: left;
	height: 30px;
}
.texttit{
	width: 30%;
	float: left;
	height: 30px;
	line-height: 2;
}
.eduitembtn{
	
	width: 19%;
	height: 30px;
	float: left;
    padding-top: 10px;
}
</style>
